import Vue from 'vue'
import Vuex from 'vuex'
import cart from './modules/cart.js'
Vue.use(Vuex);

//存放状态
var state = {
	flag:true,
	users:[
		{
			name: '蒋少川',
			username: '18810926125',
			password: '926125',
			sex: 'man'
		},
		{
			name: '王文单',
			username: '18290289199',
			password: '289199',
			sex: 'woman'
		}
	],
	name: '',
	sex: ''
}
//存放如何更改状态
var mutations = {
	setName(state,str){
		state.name = str
	},
	setSex(state,str){
		state.sex = str
	}
}

var store = new Vuex.Store({
	state,
	mutations,
	modules:{cart}
})
export default store;
